package com.usian.wemedia.controller;

import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.dtos.WmUserDto;
import com.usian.model.media.pojos.WmUser;
import com.usian.wemedia.WmUserControllerApi;
import com.usian.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/v1/user")
public class WmUserController implements WmUserControllerApi {
    @Autowired
    private WmUserService wmUserService;



    /**
     * 创建自媒体账号
     * @param wmUser
     * @return
     */
    @PostMapping("/save")
    @Override
    public WmUser saveWmUser(@RequestBody WmUser wmUser) {
        return wmUserService.saveWmUser(wmUser);
    }

    /**
     * 根据自媒体用户查询用户
     * @param name
     * @return
     */
    @GetMapping("/findByName/{name}")
    @Override
    public WmUser findByName(@PathVariable String name) {
        return wmUserService.findByName(name);
    }


}
